home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2005 Utilities / CHIP Utilities 2005 / CHIP Utilities 2005.iso / dosapps / freedos / help / mode.en < prev    next >
Encoding:
Text File  |  2000-08-05  |  14.6 KB  |  365 lines

  1.     Program usage documentation for the Free-DOS MODE program
  2.  
  3.     (c) Copyright 1994-1995 by K. Heidenstrom.
  4.  
  5.     Modified:
  6.  
  7.     KH.19941231.001  (MODE 1.0.0)  First version
  8.     KH.19950116.002  (MODE 1.0.2)  Added switchar documentation
  9.     KH.19950520.003  (MODE 1.0.3)  No changes to functionality
  10.     KH.19950805.004  (MODE 1.0.4)  Added modifier (shift-state) stuff
  11.  
  12.  
  13. 1.  LEGAL
  14.  
  15.     This program is Copyright 1994-1995 by K. Heidenstrom.    It was
  16.     written specifically for the Free-DOS project.    The author may
  17.     be reached at kheidens@actrix.gen.nz on the Internet or by snail
  18.     mail: K. Heidenstrom c/- P.O. Box 27-103, Wellington, New Zealand.
  19.  
  20.     This program is free software.    You may redistribute the source and
  21.     executable and/or modify the program under the terms of the GNU
  22.     General Public License as published by the Free Software Foundation;
  23.     either version 2 of the License, or (at your option) any later version.
  24.  
  25.     This program is distributed in the hope that it will be useful,
  26.     but is provided "as-is", without any warranty of any kind, including
  27.     the implied warranty of merchantability or fitness for a particular
  28.     purpose.  In no event will the author be liable for any damages of
  29.     any kind related to the use of this program.  See the GNU General
  30.     Public License for more details.
  31.  
  32.     You should have received a copy of the GNU General Public License
  33.     along with this program; if not, write to the Free Software
  34.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  35.  
  36. 2.  FUNCTION AND USAGE SYNTAX
  37.  
  38.     The MODE program performs six separate functions, which are
  39.     described separately below.
  40.  
  41. 2.1.  SET VIDEO MODE AND NUMBER OF SCREEN LINES
  42.  
  43.     MODE allows the video mode to be set to one of five modes.  The
  44.     syntax is:
  45.  
  46.     MODE Videomode[,Lines]
  47.  
  48.     The modes are:
  49.  
  50.     MONO    Monochrome mode, as used with the MDA and Hercules adapter
  51.         cards, and also emulated on EGA and VGA cards.    This mode
  52.         is the only mode which has the ability to underline
  53.         characters on the screen by default.  This mode cannot be
  54.         selected on the CGA video card.
  55.  
  56.     BW40    40-column color-suppressed mode.  This mode is specific to
  57.         the CGA adapter, and gives a display of 40 columns by 25
  58.         lines.    The color information of the composite video signal
  59.         from the CGA card is turned off, so that the display is in
  60.         black and white on a composite color monitor, with sixteen
  61.         shades of grey.
  62.         If this mode is selected on an EGA or VGA card, or a CGA card
  63.         that is not connected to a television set or a composite color
  64.         monitor, it will appear the same as the CO40 mode (i.e. the
  65.         color will not be suppressed).    This mode cannot be selected
  66.         on MDA and Hercules video cards.
  67.  
  68.     BW80    80-column color-suppressed mode.  This mode is also specific
  69.         to the CGA adapter and is the same as BW40 except that there
  70.         are 80 columns.
  71.         If this mode is selected on an EGA or VGA card, or a CGA card
  72.         that is not connected to a television set or a composite color
  73.         monitor, it will appear the same as the CO40 mode (i.e. the
  74.         color will not be suppressed).    This mode cannot be selected
  75.         on MDA and Hercules video cards.
  76.  
  77.     CO40    40-column color mode.  This mode gives 40 columns by 25 lines
  78.         color display.    It is supported by CGA, EGA, and VGA adapters
  79.         but not by MDA and Hercules cards.
  80.  
  81.     CO80    80-column color mode.  This mode gives an 80 column by 25 line
  82.         display and is the normal display mode for CGA, EGA and VGA
  83.         cards.    It is not supported by MDA and Hercules cards.    On EGA
  84.         cards, this mode also supports a 43-line variant, and on VGA
  85.         cards, the 43-line variant and a 50-line variant are supported.
  86.  
  87.         The 43-line and 50-line modes can be selected by specifying
  88.         ",43" or ",50" after the CO80 on the MODE command line.  If
  89.         this parameter is not specified, the default of 25 lines will
  90.         be used.
  91.  
  92.     Once set, the video mode will remain in effect until changed by
  93.     a MODE command or by a program.  The video mode is not locked
  94.     permanently - programs are free to change video modes as they
  95.     require.
  96.  
  97. 2.2.  CONFIGURE SERIAL PORT PARAMETERS
  98.  
  99.     MODE allows the communication parameters of a serial port to be
  100.     configured.  The syntax is:
  101.  
  102.     MODE COMn:r,p,d,s
  103.  
  104.     n    Specifies which serial port is to be configured, in the range
  105.         1 to 4.  If the serial port does not exist, MODE will report
  106.         an error.
  107.  
  108.     r    Specifies the baud rate in bits per second.  Values are:
  109.         50, 110, 150, 300, 600, 1200, 2400, 4800, 9600, 14400,
  110.         19200, 28800, 38400, 57600, and 115200.
  111.  
  112.         1200, 2400, 4800, and 9600 may be abbreviated to 12, 24,
  113.         48 and 96 respectively.  14400, 19200, 28800, 38400, and
  114.         57600 may be abbreviated to their first two or three digits.
  115.         115200 may be abbreviated to 115 or 1152.
  116.  
  117.     p    Specifies the type of parity generated and checked on
  118.         the data bytes.  Values are:
  119.  
  120.         E = Even parity
  121.         O = Odd parity
  122.         N = No parity
  123.  
  124.     d    Specifies the number of data bits that will be transmitted
  125.         and received.  The allowable values are 5, 6, 7, and 8.
  126.  
  127.     s    Specifies the number of stop bits that will be transmitted
  128.         and expected.  This may be 1 or 2.  If 2 stop bits are
  129.         used in conjunction with 5 data bits, the serial port will
  130.         actually generate and check 1 1/2 stop bits.
  131.  
  132.     Once set, the serial port parameters will remain in effect until
  133.     changed by a MODE command or by a program.  The serial port settings
  134.     are not locked permanently - programs are free to change them as
  135.     they require.
  136.  
  137. 2.3.  PARALLEL PORT REDIRECTION AND INFINITE RETRIES
  138.  
  139.     MODE allows parallel (LPT) port output to be redirected to a serial
  140.     (COM) port, to NUL (i.e. nothing), and also can retry indefinitely
  141.     if the peripheral fails to respond.
  142.  
  143.     These functions are performed by the resident portion of MODE, which
  144.     will be automatically installed if necessary when the function is
  145.     requested.
  146.  
  147.     The syntax is:
  148.  
  149.     MODE LPTn:P        Infinite timeout on parallel port
  150.     MODE LPTn:=COMx        Redirect printer output to COM port
  151.     MODE LPTn:=NUL:        Redirect printer output to NUL
  152.     MODE LPTn:        Remove redirection and infinite timeout
  153.  
  154.     The LPTn:P function specifies infinite retries on timeout.  If
  155.     this is enabled, MODE will retry continuously if the printer
  156.     fails to respond.  If this is not enabled, and the printer fails
  157.     to respond within a certain length of time (typically about half
  158.     a minute), a write fault error will be reported.
  159.  
  160.     The LPTn:=COMx and LPTn:=NUL: functions specify redirection of
  161.     printer output.  Any parallel port (whether it exists or not) may
  162.     be redirected to any existing serial port, or to NUL.  More than
  163.     one parallel port may be redirected to the same serial port or
  164.     to NUL.  These functions are useful if you have a serial printer,
  165.     or if you have no printer and want to avoid locking up the computer
  166.     if a program attempts to print to a nonexistent printer.
  167.  
  168.     The LPTn: function removes any redirection and infinite timeout
  169.     that may be configured for the specified port, and returns it to
  170.     normal operation.
  171.  
  172. 2.4.  HARD DISK PARK FUNCTIONS
  173.  
  174.     MODE will park the hard disk or hard disks (only the first two
  175.     physical hard disks in the system), either immediately, or after
  176.     the disk has been idle for a period of time.
  177.  
  178.     The timed park function is performed by the resident portion of MODE,
  179.     which will be automatically installed if necessary when the function
  180.     is requested.
  181.  
  182.     The syntax is:
  183.  
  184.     MODE PARK            Park now
  185.     MODE PARK,minutes[:seconds]    Park after hard disk has been idle
  186.  
  187.     The PARK function parks the hard disk(s) immediately and waits for
  188.     you to switch off the computer.  You can also press Ctrl-C to quit
  189.     and return to DOS.
  190.  
  191.     The PARK,minutes[:seconds] function causes the hard disk(s) to be
  192.     parked after a certain period of inactivity, which may be up to
  193.     50 minutes.  If you have two physical hard disks, they are both
  194.     handled separately.
  195.  
  196.     Once set, you can change the time period by executing the command
  197.     again with a different time value.  The timed park function cannot
  198.     be turned off - you must reboot to remove it.
  199.  
  200.     These functions are generally only useful for older machines.
  201.     Modern hard drives park themselves automatically when switched
  202.     off.
  203.  
  204. 2.5.  TYPEMATIC FUNCTIONS
  205.  
  206.     MODE allows the typematic (auto-repeat) initial repeat delay and
  207.     repeat rate parameters to be set, and optionally locked.
  208.  
  209.     The typematic lock function is performed by the resident portion of
  210.     MODE, which will be automatically installed if necessary when the
  211.     function is requested.
  212.  
  213.     The syntax is:
  214.  
  215.     MODE DELAY=d RATE=r        Set typematic parameters
  216.     MODE DELAY=d RATE=r LOCK    Set and lock typematic parameters
  217.  
  218.     d    Specifies the initial delay, the range is 1 to 4 and the
  219.         delay is between 1/4 second (1) and one second (4).
  220.  
  221.     r    Specifies the auto-repeat rate.  The range is 1 to 32 and
  222.         the rate is between two repeats per second (1) and 30 repeats
  223.         per second (32).
  224.  
  225.     LOCK    Specifies that the typematic parameters should be locked.
  226.         Once this is done, the typematic parameters may be changed
  227.         by runing MODE again, but cannot be changed by most other
  228.         programs.  This can be useful, as some programs will change
  229.         the typematic parameters without your permission.  It is
  230.         not completely foolproof, however, and there are several
  231.         things that a program could do which will defeat the locking
  232.         feature of MODE.
  233.  
  234.     Note that both DELAY and REPEAT must be specified for these functions.
  235.  
  236.     MODE does not attempt to confirm that typematic setting is available
  237.     on the machine.  I tried to do this using int 15h function 0C0h and
  238.     int 16h function 9 but it seems that these are not fully supported
  239.     by enough machines to be a reliable indicator.    MODE will accept all
  240.     typematic commands, whether or not the machine actually supports them.
  241.  
  242. 2.6.  SWITCHAR FUNCTIONS
  243.  
  244.     MODE can display and set the DOS switch character (switchar).
  245.     The default switchar is the forward slash, '/'.  The switchar is the
  246.     character that is used to indicate the start of an option switch, e.g.
  247.     the /P switch to the DIR command.  Typically, the switchar may be
  248.     changed to '-'.  The switchar is an undocumented DOS feature that is
  249.     properly supported by few programs.
  250.  
  251.     The syntax is:
  252.  
  253.     MODE SWITCHAR            Display current switchar
  254.     MODE SWITCHAR=x            Set switchar to character
  255.     MODE SWITCHAR=n            Set switchar to ASCII value n
  256.  
  257.     The SWITCHAR parameter by itself causes MODE to display the current
  258.     switchar.  The SWITCHAR= usage sets the switchar.  The new switchar
  259.     may be specified as a character (e.g. 'MODE SWITCHAR=/') or as a
  260.     number (e.g. 'MODE SWITCHAR=45').
  261.  
  262. 2.7.  MODIFIER (SHIFT STATE) FUNCTIONS
  263.  
  264.     MODE can change the three sticky shift-states (caps lock, numlock,
  265.     and scroll lock).  This function should not be used on machines with
  266.     original PC or XT keyboards, because the indicator LEDs on these
  267.     keyboards cannot be controlled from the computer, and will become
  268.     out of step with the computer's shift-states.  MODE does not detect
  269.     these machines, however.  On ATs and later machines, there is no
  270.     problem.
  271.  
  272.     The parameter syntax for this command consists of the following
  273.     options:
  274.  
  275.         CAPSLOCK=ON    CAPSLOCK=OFF
  276.         NUMLOCK=ON    NUMLOCK=OFF
  277.         SCRLOCK=ON    SCRLOCK=OFF
  278.  
  279.     Any non-conflicting and non-duplicated combinations of these options
  280.     is allowed.  Also, SCRLOCK can be expanded to SCROLLLOCK.
  281.  
  282. 3.  GENERAL
  283.  
  284.     Parameters to MODE are not case sensitive.
  285.  
  286.     MODE can only process one command on each invocation.  If you
  287.     want to redirect several LPT ports, you must use a separate
  288.     MODE command for each.    Commands of different types cannot be
  289.     combined on the command line.
  290.  
  291.     Error messages are always sent to StdErr, which is not redirected
  292.     by the DOS output redirection facilities.  Informational messages
  293.     are sent to standard output, and may be redirected to NUL: for
  294.     'quiet' operation.
  295.  
  296.     Errorlevels returned by MODE are as follows:
  297.  
  298.     0    No error
  299.     115    Serial port does not exist (either for COMn: or LPTn:=COMx)
  300.     117    No hard disk(s) found to park
  301.     118    Specified video mode is not supported on this machine
  302.     162    Insufficient memory (MODE requires about 6K of memory)
  303.     241    Parameter out of range (e.g. time value, LPT port number etc)
  304.     242    Cannot have 43-line or 50-line modes with modes other than CO80
  305.     243    Unknown baud rate
  306.     244    Must specify both DELAY= and RATE= for typematic setting
  307.     246    More than one command or command type was given
  308.     255    Incorrect usage syntax (all usage syntax errors)
  309.  
  310.     MODE is a TSR program.    If required, MODE will install part of itself
  311.     resident in the computer's memory.  This resident portion performs
  312.     printer redirection and timeout handling, automatic parking of the
  313.     hard drive, and locking of the typematic parameters, and cannot be
  314.     removed without rebooting (unless the public domain MARK and RELEASE
  315.     programs are used).  If additional resident functions are required
  316.     and the resident portion is installed, MODE will enable those
  317.     functions in the resident portion rather than installing another
  318.     resident portion.
  319.  
  320.     Because MODE is a TSR, it may be incompatible with applications
  321.     or other TSRs you may be using.  If problems occur, try to establish
  322.     which programs are conflicting.  It may be possible to avoid the
  323.     problem by installing the programs in a different order.
  324.  
  325.     If you find a bug in MODE, please inform the author.  The contact
  326.     details are given in section 1 of this document and in the source
  327.     code.
  328.  
  329. 4.  USAGE EXAMPLES
  330.  
  331.     Here is a sample of MODE's usage in AUTOEXEC.BAT, demonstrating all
  332.     features:
  333.  
  334.     mode co80,43            >nul:
  335.     mode com1:96,n,8,1        >nul:
  336.     mode com2:19,n,8,1        >nul:
  337.     mode com3:24,n,8,1        >nul:
  338.     mode lpt1:=com2            >nul:
  339.     mode lpt1:p            >nul:
  340.     mode lpt2:=nul:            >nul:
  341.     mode lpt3:=nul:            >nul:
  342.     mode park,0:30            >nul:
  343.     mode delay=1 rate=32 lock    >nul:
  344.     mode switchar=-            >nul:
  345.     mode numlock=off        >nul:
  346.  
  347.     This sequence firsts selects 43-line color display mode, then
  348.     configures the serial port parameters for COM1, COM2 and COM3
  349.     (9600, 19200, and 2400 bps respectively, with no parity, eight
  350.     data bits and one stop bit).  These serial port parameters are
  351.     not locked permanently, and another MODE command or another
  352.     program may change these at any time.
  353.     Then, LPT1 output is redirected to COM2, so anything that is
  354.     printed to LPT1 will be sent out COM2 instead, at 19200 bps
  355.     (for example, to a serial laser printer), and LPT2 and LPT3
  356.     are redirected to NUL so that anything that is sent to them
  357.     will go nowhere.
  358.     Then a timed hard disk park is installed, which will park the
  359.     hard disk(s) after 30 seconds of no hard disk activity.
  360.     Finally, the shortest delay and fastest rate for the keyboard
  361.     typematic function is selected and locked, and the DOS switchar
  362.     is set to a hyphen ('-').
  363.  
  364.                    ----//----
  365.